<template>
	<view class="myordersmianbox">
		<qi_navigation :navzuoicof="'icon-icon-test59'"></qi_navigation>
		<qi_tabControl
			@tabClick="tabClick"
			:titles="['下单', '支付', '发货', '收货']"
		></qi_tabControl>
		<scroll-view scroll-y class="scroll" >
			<view v-for="item in data.goods">
				<qi_cartgoods :goods="item.goods"></qi_cartgoods>
				<!-- <qi_cartlist  :goods="item.goods" > </qi_cartlist> -->
			</view>
		</scroll-view>
	</view>
</template>

<script setup>
import { getorders } from '@/http/api.js';
import { reactive, onMounted } from 'vue';
const data = reactive({
	Query: {
		page: 1,
		title: '',
		status: 1
	},
	goods: []
});
onMounted(() => {
	getorders(data.Query).then(res => {
		data.goods = res.data
			.map(item => item.orderDetails.data)
			.flat(Infinity);
	});
});
const tabClick = index => {
	data.Query.status = ++index;
	console.log(data.Query.status);
	getorders(data.Query).then(res => {
		console.log(res);
		data.goods = res.data
			.map(item => item.orderDetails.data)
			.flat(Infinity);
	});
};
</script>

<style lang="scss">
.myordersmianbox {
	position: relative;
	height: 100vh;
	.scroll {
		height: calc(100vh - 100px);
	}
}
</style>
